package com.gbcom.autocompile.prop;

import com.gbcom.op.properties.Config;
import com.gbcom.op.properties.SimpleConfig;

/**
 * Peng 博士系统 参数工具类 ,静态类实现
 * 
 * 读取 peng.sys.properties
 * 
 * @author SunYanzheng
 * @date 2014-12-10
 * @version v1.0.0
 * @see com.gbcom.SysProperies.TrapSetupProperies.server.service.peng.PengSysProperies
 */
public class SysProperies {
	private static final String FILE_COFIG= "config/sys.properties";
	private static Config config = new SimpleConfig(FILE_COFIG);
	
	
	
	private static Config getConfig(){
		if(config == null){
			synchronized (config) {
				config = new SimpleConfig(FILE_COFIG);
			}
		}
		
		return config;
	}
	
	
	/**
	 * 根据key 获取value  不存在返回null
	 * 
	 * @param key String
	 * @return String
	 */
	public static String getValue(String key){
		return getConfig().getString(key).trim();
	}
}
